package com.ruoyi.qiushi.service.followup.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.equipment.QiushiWarning;
import com.ruoyi.qiushi.domain.followup.QiushiForm;
import com.ruoyi.qiushi.domain.system.QiushiMessage;
import com.ruoyi.qiushi.domain.user.MemberUserFamily;
import com.ruoyi.qiushi.mapper.followup.QiushiFormMapper;
import com.ruoyi.qiushi.mapper.system.QiushiMessageMapper;
import com.ruoyi.qiushi.mapper.user.MemberUserFamilyMapper;
import com.ruoyi.qiushi.service.followup.IQiushiFormService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 问答单Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-19
 */
@Service
public class QiushiFormServiceImpl implements IQiushiFormService {
    @Autowired
    private QiushiFormMapper qiushiFormMapper;

    /**
     * 查询问答单
     *
     * @param id 问答单主键
     * @return 问答单
     */
    @Override
    public QiushiForm selectQiushiFormById(Long id) {
        return qiushiFormMapper.selectQiushiFormById(id);
    }

    /**
     * 查询问答单列表
     *
     * @param qiushiForm 问答单
     * @return 问答单
     */
    @Override
    public List<QiushiForm> selectQiushiFormList(QiushiForm qiushiForm) {
        return qiushiFormMapper.selectQiushiFormList(qiushiForm);
    }

    /**
     * 新增问答单
     *
     * @param qiushiForm 问答单
     * @return 结果
     */
    @Override
    public int insertQiushiForm(QiushiForm qiushiForm) {
        qiushiForm.setCreateTime(DateUtils.getNowDate());
        return qiushiFormMapper.insertQiushiForm(qiushiForm);
    }

    /**
     * 修改问答单
     *
     * @param qiushiForm 问答单
     * @return 结果
     */
    @Override
    public int updateQiushiForm(QiushiForm qiushiForm) {
        qiushiForm.setUpdateTime(DateUtils.getNowDate());
        return qiushiFormMapper.updateQiushiForm(qiushiForm);
    }

    /**
     * 删除问答单信息
     *
     * @param id 问答单主键
     * @return 结果
     */
    @Override
    public int deleteQiushiFormById(Long id) {
        return qiushiFormMapper.deleteQiushiFormById(id);
    }
}
